Welcome to Bryton in three hours.
Hello, everyone.
This of three operations, billing functions and data types, by the end of this lecture, you will
be able to describe some python building functions, create python lists, two pills and dictionaries,
call elements of python lists, doorbells and dictionaries with strings and print information and perform
basic mathematics in Python, commenting and some building functions for commenting.
You can simply type of whatever you want to tie, but start with a hashtag at the beginning.
For example.
Hashtag.
Hello everybody.
If you on the cell, nothing happens.
It just passed through your comments to print some information.
You can use the building print function in python italic print and for functions.
We always use open and close parentheses to put some input into that function.
The function might not need to receive any input.
And once you open the Brightside side LB's, you will see some explanation's popping up regarding that
function.
For this particular example, I'm going to use single quotation and in type whatever I want to type
in that single quotation.
You can also use double quotations if you have single quotations within your string to print a string
within the single quotation, you can type like a lowballed or whatever you want to type if you run
this this kind of print for you as well as the output of that.
So another way to print is to print whatever that is in the last line of your code.
If you put there some data types such as integer booleans, strings or other types of data in Python
in the very last line of a cell, it will print it for you.
For example, here on line three, I have print Hello World.
And then number 23, I the last line, if your only cell in principle you Hanawalt and also the number
twenty three, let's say I have printed level number 23 on line for and HelloWallet in a quotation in
the last line of the cell.
If you run the cell it brings for you how well it does in print for you 23 anymore because it's not
on the last line but it prints for you another HelloWallet.
But this time it is within the quotation similar to many programming languages.
Python understands different data types, for example, integers, booleans, strings and other forms
to find the type of value or object or variables.
You can simply put that object as an input after type function you type type open until apprentice's
and put that object as the input of that type function.
And since it is on the last line of the cell, if arantes it prints for you i n t which stands for integer.
If you type here ebullience such as true R&D, it types for your bool.
If you have a string here it types for you.
ETR as string.
Let's look into more printing examples.
For example, here on line two I typed print type of 23 and on line three we are printing for different
things.
Each one is separated from the other, one using it at the beginning.
I have the type of a boolean, next I have the type of another boolean.
Here I have a string and then a no.
If I run this, sell it first prints for me, the class of that number twenty three, then the second
plane which prints for me the type of boolean true.
Which is class boolean type of boolean false boolean and a string iten is fun.
And that followed number seven eight point forty five.
Note that there is no comma between these different four things that have been printed here.
They just been printed back to back with one one space.
Here we have a little bit more sophisticated version of print, which is very useful here.
I'm going to say print of an Pantazis and I have a string within double quotation and I'm going to say
my name is open and close calibrates is here.
My number is open and close curly braces and my number type is open and close curly braces.
Then if you put a dot here and type format open and close parenthesis here, why put some space here.
So this is the parenthesis corresponding to the format and this format in this example has three inputs.
Each input is corresponding to a curly braces in order.
For example, the first one is corresponding to the first curly braces.
The second one is corresponding to the second curly brace and the third one is corresponding to the
last curly brace or third curly brace.
And you can print some dots or any other things if you want to separate whatever you print here from
the next print that you might have after this.
But we don't have to have these.
Let me just remove it and then run this.
So it says, my name is John, my number is 23 and my number type is type of 23, which is class integer.
Simple mathematics and variable assignments.
Each cell is similar to a simple calculator you can type here simple mathematics, for example, two
divided by four times five plus open and close practices.
And within parentheses, we have three times seven plus two.
And that practice is going to be the departure of three and four to the other.
We have double A here and then all of this is going to go to the power of half if you on the cell,
since this is on the last line up to sell, it means for you the result of this mathematical operation.
You can do variable assignments in Python, for example.
You can define a variable X say equal to two plus two point four, three or Y equals to two divided
by five.
You can also assign the resultant of logical expressions variable.
For example, check if two is not equal to four and the result of these is a boolean, for example.
True or false.
And they're going to be that boolean or here you equals to check if three is greater than two point
three here we check if two divided by five is equal, two point five.
Note that four is equal.
We have double equality's and four is not equal.
Here we had exclamation mark and equality.
You can also have multiple logical explanations here divided with and or for example, check if two
is greater than four or three is greater than one.
And if either of these are true then they're going to be true or otherwise false.
You can expand your logical explanations with multiple hands and multiple orders.
For example, check if two is greater than four and three is greater than one or whatever is the result
of Z, which is either true or false.
And T actually gets the corresponding boolean of these logical explanation.
I chose X, Y, Z to T here as my variable names.
Part your variable names, but get more sophisticated name.
For example, you could use lowercase or uppercase letters, you can use underline and other letters,
the numbers and so on.
You are not using the hash and you are not using numbers at the beginning of your variable name.
For example, use variable name is equal to X times Y and I'm going to print here for you X to T and
this variable starting with lowercase W here, I'm going to bring some dots here for separation's and
then just for practice I'm going to print in double quotations.
The value of X is calibrates and Y caliber I says, but I have the second curly braces in single quotation
and then my format function you're going to get X and Y and X goes to the first calibrates and Y go
to the second calibrates.
The Israelis.
I have my first preened at line twelve here, the back to back result and of these variables.
And then here I have the value of X is four point four, three and Y in single quotation point for.
Let's take a break and then continue to the next part of this election.